home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
lcppb.zip
/
LCPPANS.ZIP
/
UPFILE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-08
|
674b
|
35 lines
// upfile.cpp -- Convert text file to uppercase
#include <iostream.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
main(int argc, char *argv[])
{
FILE *fp;
char c;
if (argc == 1) {
cout << "ERROR: No file name";
exit(1);
}
fp = fopen(argv[1], "r");
if (!fp) {
cout << "ERROR: File not found";
exit(2);
}
while ((c = fgetc(fp)) != EOF)
cout << char(toupper(c));
fclose(fp);
exit(0);
}
// Copyright (c) 1990 by Tom Swan. All rights reserved
// Revision 1.00 Date: 12/06/1990 Time: 08:49 am
// Revision 1.01 Date: 07/08/1991 Time: 05:41 pm
// Converted for Borland C++ 2.0